package com.example.module_web.view.fragment;




import com.example.module_web.R;
import com.example.module_web.adapter.GridViewAdapter;
import com.example.module_web.base.BaseFragment;
import com.example.module_web.beans.Result;
import com.example.module_web.databinding.WebFragmentGoodspictureBinding;
import com.example.module_web.viewmodule.NetData_Web;

/**
 * Created by admin on 2018/1/22.
 */

public class Fragment_03 extends BaseFragment<WebFragmentGoodspictureBinding> {
    private WebFragmentGoodspictureBinding mBinding;
    private String[] picurl;
    @Override
    public int setLayoutId() {
        return R.layout.web_fragment_goodspicture;
    }

    @Override
    public void init(WebFragmentGoodspictureBinding binding) {
        this.mBinding=binding;
        NetData_Web.getInstance().getPicture(getContext(),"Snapshot", new NetData_Web.Singer<Result>() {
            @Override
            public void success(Result s) {
                picurl=s.getResult().split("\\+");
                GridViewAdapter gridAdapter=new GridViewAdapter(getContext(),picurl,false,R.layout.web_item_goodspicture_fragment,getFragmentManager());
                mBinding.gridPicture.setAdapter(gridAdapter);
            }
            @Override
            public void failed(String s) {
            }
        });
    }
}
